﻿using Atomic;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;

namespace JTActiveSafety.Gateway.Abstractions
{
    public abstract class JTActiveSafetySession
    {
        public JTActiveSafetySession(ConnectionContext connectionContext,string terminalPhoneNo)
        {
            BaseConnectionContext = connectionContext;
            RemoteEndPoint = connectionContext.RemoteEndPoint;
            LastActiveTime = DateTime.Now;
            StartTime = DateTime.Now;
            TerminalPhoneNo = terminalPhoneNo;
            SessionId = connectionContext.ConnectionId + "_" + terminalPhoneNo;
        }
        /// <summary>
        /// ConnectionId + TerminalPhoneNo
        /// </summary>
        public string SessionId { get; }
        /// <summary>
        /// 终端手机号
        /// </summary>
        public string  TerminalPhoneNo { get;}
        public ConnectionContext BaseConnectionContext { get; }
        public DateTime StartTime { get; set; }
        public DateTime LastActiveTime { get; set; }
        public virtual JTActiveSafetyTransportProtocolType TransportProtocolType { get;}
        public EndPoint RemoteEndPoint { get; }
    }
}
